<template>
  <div class="blogPage-box flex-row">
    <div class="page-total ml0">共&nbsp;{{pageInfo.total}}&nbsp;条</div>
    <div class="page-box flex-row">
      <div class="left-page flex-hv-center mt10" @click="changePage('left')">
        <i class="cp el-icon-arrow-left"></i>
      </div>
      <div class="page flex-row">
        <div style="color: #3593f2;">{{pageInfo.current}}</div>
        <div class="ml10 mr10">/</div>
        <div>{{Math.ceil(pageInfo.total / pageInfo.size)}}</div>
      </div>
      <div class="right-page flex-hv-center mt10" @click="changePage('right')">
        <i class="cp el-icon-arrow-right"></i>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'BlogPage',
  props: {
    pageInfo: {
      required: true,
      type: Object
    }
  },
  methods: {
    changePage(type) {
      this.$emit('changePage', type)
    }
  }
}
</script>

<style scoped lang="less">
.blogPage-box {
  .page-total {
    width: 30%;
    font-size: 14px;
    color: #4b595f;
  }
  .page-box {
    width: 70%;
    .page {
      padding: 0 20px;
    }
    .left-page,
    .right-page {
      width: 40px;
      height: 40px;
      border-radius: 40px;
      border: 1px solid #eee;
      &:hover{
        border: 1px solid #3593f2;
      }
      i {
        font-size: 24px;
        color: #767c82;
        &:hover {
          color: #3593f2;
        }
      }
    }
  }
}
</style>